package com.aoxin.controller.system;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.aoxin.model.system.SlfOperateLog;
import com.aoxin.service.inter.system.OperateLogService;
import com.aoxin.util.AjaxRes;
import com.aoxin.util.Const;
import com.aoxin.util.enumerate.OperateType;
import com.aoxin.util.log.LogInfo;

/**
 * 操作日志Controller
 * 
 * @author Melody
 * @date 2018年3月27日 下午3:36:50
 */
@Controller
@ResponseBody
@RequestMapping("/web/log")
public class OperateLogController {

	@Autowired
	private OperateLogService operateLogService;

	@RequestMapping("/getOperateLogList")
	@LogInfo(content = "日志", operateType = OperateType.QUERY)
	public AjaxRes getOperateLogList(@RequestParam Map<String, Object> map, AjaxRes ajaxRes) {
		try {
			List<SlfOperateLog> logs = this.operateLogService.getOperateLogList(map);
			ajaxRes.setSucceed(logs, Const.DATA_SUCCEED);
		} catch (Exception e) {
			ajaxRes.setFailMsg(e.getMessage());
		}
		return ajaxRes;
	}
}
